﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Web.UI.WebControls;

namespace HRM.BLL
{
    public class Role
    {
        DLL.Role objRole;
        public Role()
        {
            objRole = new DLL.Role();
        }
        public DataTable GetAllRoles()
        {
            return objRole.GetAllRoles();
        }
        public DataTable GetByID(int RoleID)
        {
            return objRole.GetByID(RoleID);
        }
        public int Save(BO.Role objRole_BO)
        {
            return objRole.Save(objRole_BO);
        }
        public int Delete(int RoleID)
        {
            return objRole.Delete(RoleID);
        }
        public string DeleteMultiple(string idsToDelete)
        {
            return objRole.DeleteMultiple(idsToDelete);
        }

        public static void PopulateDropDownList(String TextField, String ValueField, DropDownList ddl)
        {
            DLL.Role DLL_objRole = new DLL.Role();
            DataTable dt = DLL_objRole.GetAllRoles();
            ddl.DataSource = dt;
            ddl.DataTextField = TextField;
            ddl.DataValueField = ValueField;
            ddl.DataBind();
            DLL_objRole = null;
        }
    }
}
